<template>
  <el-card>
    <div class="box">
      <div class="avatar">
        <img draggable="false" :src="userStore.avatar" alt="" />
      </div>
      <div class="user-box">
        <div>你好 {{ userStore.username }}</div>
        <div>欢迎使用阿文电商管理系统</div>
      </div>
    </div>
  </el-card>
  <div style="width: 500px; margin: 0 auto">
    <svgIcon name="welcome" fontsize="500"></svgIcon>
  </div>
</template>

<script setup lang="ts">
import { onMounted } from 'vue'
import svgIcon from '../../components/SvgIcon/index.vue'
import useUserStore from '@/store/modules/user'
let userStore = useUserStore()
</script>

<style lang="scss" scoped>
.el-card__body {
  height: 78px;
}
.box {
  width: 100%;
  height: 80px;
  display: flex;
  align-items: center;
  .avatar {
    width: 80px;
    height: 80px;
    // background-color: aqua;
    border-radius: 50%;
    overflow: hidden;
    img {
      width: 100%;
      height: 100%;
      border-radius: 50%;
      object-fit: cover;
    }
  }
  .user-box {
    margin-left: 32px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    div {
      color: #999;
    }
    :first-child {
      font-weight: 700;
      font-size: 28px;
      color: #000;
    }
  }
}
</style>
